package com.itheima.ai.maolong;

import org.springframework.ai.chat.memory.ChatMemory;
import org.springframework.ai.chat.messages.Message;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

@Repository
public class ChatMemoryRepository implements ChatMemory {
    //保存会话信息到mongodb中.todo 学习mongodb的使用

    //这里搞一个内存缓存;
    Map<String,List<Message>> map = new ConcurrentHashMap<>();

    @Override
    public void add(String conversationId, List<Message> messages) {

    }

    @Override
    public List<Message> get(String conversationId, int lastN) {
        return List.of();
    }

    @Override
    public void clear(String conversationId) {

    }
}
